package homwork;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class Note {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("note.txt");
        Scanner scanner=new Scanner(System.in);
        System.out.println("请开始输入内容,'exit'退出");
        boolean ture;
        while (true){
            String line=scanner.nextLine();
            if ("exit".equals(line)){
                break;
            }
            byte[]data=line.getBytes(StandardCharsets.UTF_8);
            fos.write(data);
        }
        System.out.println("再见!");
        fos.close();
    }
}
